# -*- coding: utf-8 -*-

class TFieldInfo(dict):
    def __init__(self):
        dict.__init__(self)

    def asDict(self):
        data = {
            "index": self["index"],
            "cropId": self["cropId"],
            "plantTime": self["plantTime"],
        }
        return data

    def createFromDict(self, dictData):
        self["index"] = dictData["index"]
        self["cropId"] = dictData["cropId"]
        self["plantTime"] = dictData["plantTime"]
        return self

class FIELD_INFO:
    def __init__(self):
        pass

    def createObjFromDict(self, dict):
        return TFieldInfo().createFromDict(dict)

    def getDictFromObj(self, obj):
        return obj.asDict()

    def isSameType(self, obj):
        return isinstance(obj, TFieldInfo)

field_info_inst = FIELD_INFO()